import {post,text} from '@/common/request';
import {requestParams, urlApiClientContent, urlPublicContent} from './ServerService';

const photoItemUrl = urlApiClientContent + 'photoItem/';
const stuItemMarketUrl = urlApiClientContent + 'stuItemMarket/'

// 拍照搜题 
export function upPictureToItem({base64}) {
    return text(photoItemUrl +  requestParams('upPictureToItem', {}), base64);
}

// 查询题库市场 
export function pageItemMarket({queryKey,pageNo,pageSize}) {
    return post(stuItemMarketUrl +  requestParams('pageItemMarket', {queryKey,pageNo,pageSize}), null);
}

// 查询题库市场详情
export function getItemMarketDetail({marketId}) {
    return post(stuItemMarketUrl +  requestParams('getItemMarketDetail', {marketId}), null);
}


// 查询练习
export function listPractice({marketId,practiceType}) {
    return post(stuItemMarketUrl +  requestParams('listPractice', {marketId,practiceType}), null);
}

// 开始练习
export function startPractice({practiceUuid,marketId,practiceType,structUuid,itemType}) {
    return post(stuItemMarketUrl +  requestParams('startPractice', {practiceUuid,marketId,practiceType,structUuid,itemType}), null);
}


// 搜索试题
export function seachItem({marketId,itemText}) {
    return post(stuItemMarketUrl +  requestParams('seachItem', {marketId,itemText}), null);
}

// 查询模拟考试-科目下的题型和数量
export function getMarketExamItemType({marketId}) {
    return post(stuItemMarketUrl +  requestParams('getMarketExamItemType', {marketId}), null);
}

// 组卷
export function composePaper({marketId,json}) {
    return text(stuItemMarketUrl +  requestParams('composePaper', {marketId}), json);
}

//  获取我的错题/收藏-统计
export function listMyExerciseItemCount({marketId,type}) {
    return post(stuItemMarketUrl +  requestParams('listMyExerciseItemCount', {marketId,type}), null);
}

//  获取我的错题/收藏-题型
export function listMyExerciseItemType({marketId,type}) {
    return post(stuItemMarketUrl +  requestParams('listMyExerciseItemType', {marketId,type}), null);
}


//  查询历史练测
export function listHisChecksPaper({marketId}) {
    return post(stuItemMarketUrl +  requestParams('listHisChecks', {marketId}), null);
}

// 学习成果
export function getMarketResult({marketId}) {
    return post(stuItemMarketUrl +  requestParams('getMarketResult', {marketId}), null);
}

// 学习趋势
export function getMarketTrend({marketId}) {
    return post(stuItemMarketUrl +  requestParams('getMarketTrend', {marketId}), null);
}

// 题型情况
export function getMarketItemSituation({marketId}) {
    return post(stuItemMarketUrl +  requestParams('getMarketItemSituation', {marketId}), null);
}

// 知识结构分析
export function getMarketItemStructAnalysis({marketId}) {
    return post(stuItemMarketUrl +  requestParams('getMarketItemStructAnalysis', {marketId}), null);
}